
<!DOCTYPE html>

<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

    <title>FVP &#8212; LAVA 2024.05 documentation</title>
    <link rel="stylesheet" type="text/css" href="_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="_static/bootstrap-sphinx.css" />
    <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
    <script src="_static/jquery.js"></script>
    <script src="_static/underscore.js"></script>
    <script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
    <script src="_static/doctools.js"></script>
    <script src="_static/sphinx_highlight.js"></script>
    <link rel="shortcut icon" href="_static/favicon.ico"/>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="AVH" href="avh.html" />
    <link rel="prev" title="Administering LAVA using Docker" href="docker-admin.html" />
    <link rel="canonical" href="https://docs.lavasoftware.org/lava/fvp.html" />
  
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
<meta name="apple-mobile-web-app-capable" content="yes">
<script type="text/javascript" src="_static/js/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="_static/js/jquery-fix.js"></script>
<script type="text/javascript" src="_static/bootstrap-3.4.1/js/bootstrap.min.js"></script>
<script type="text/javascript" src="_static/bootstrap-sphinx.js"></script>


  </head><body>

  <div id="navbar" class="navbar navbar-default navbar-fixed-top">
    <div class="container">
      <div class="navbar-header">
        <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="index.html"><span><img src="_static/lava.png"></span>
          LAVA</a>
        <span class="navbar-text navbar-version pull-left"><b>2024.05</b></span>
      </div>

        <div class="collapse navbar-collapse nav-collapse">
          <ul class="nav navbar-nav">
            
                <li><a href="genindex.html">Index</a></li>
                <li><a href="contents.html">Contents</a></li>
            
            
              <li class="dropdown globaltoc-container">
  <a role="button"
     id="dLabelGlobalToc"
     data-toggle="dropdown"
     data-target="#"
     href="index.html">Site <b class="caret"></b></a>
  <ul class="dropdown-menu globaltoc"
      role="menu"
      aria-labelledby="dLabelGlobalToc"><ul class="current">
<li class="toctree-l1"><a class="reference internal" href="index.html">Introduction to LAVA</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="contents.html">Contents</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="glossary.html">Glossary of terms</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="support.html">Getting support</a></li>
</ul>
</ul>
</li>
              
                <li class="dropdown">
  <a role="button"
     id="dLabelLocalToc"
     data-toggle="dropdown"
     data-target="#"
     href="#">Page <b class="caret"></b></a>
  <ul class="dropdown-menu localtoc"
      role="menu"
      aria-labelledby="dLabelLocalToc"><ul>
<li><a class="reference internal" href="#">FVP</a><ul>
<li><a class="reference internal" href="#lava-fvp-dispatcher-setup">LAVA FVP Dispatcher Setup</a></li>
<li><a class="reference internal" href="#fvp-binaries">FVP Binaries</a></li>
<li><a class="reference internal" href="#building-fvp-docker-images">Building FVP Docker Images</a></li>
<li><a class="reference internal" href="#networking-inside-models">Networking inside Models</a></li>
<li><a class="reference internal" href="#reading-from-all-model-consoles">Reading from all model consoles</a></li>
</ul>
</li>
</ul>
</ul>
</li>
              
            
            
              
                
  <li>
    <a href="docker-admin.html" title="Previous Chapter: Administering LAVA using Docker"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; Administering...</span>
    </a>
  </li>
  <li>
    <a href="avh.html" title="Next Chapter: AVH"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">AVH &raquo;</span>
    </a>
  </li>
              
            
            
            
            
              <li class="hidden-sm"></li>
            
          </ul>

          
            
<form class="navbar-form navbar-right" action="search.html" method="get">
 <div class="form-group">
  <input type="text" name="q" class="form-control" placeholder="Search" />
 </div>
  <input type="hidden" name="check_keywords" value="yes" />
  <input type="hidden" name="area" value="default" />
</form>
          
        </div>
    </div>
  </div>

<div class="container">
  <div class="row">
    <div class="body col-md-12 content" role="main">
      
  <section id="fvp">
<span id="index-0"></span><h1>FVP<a class="headerlink" href="#fvp" title="Permalink to this heading">¶</a></h1>
<p>The FVP device-type in LAVA refers to running <a class="reference external" href="https://developer.arm.com/tools-and-software/simulation-models/fixed-virtual-platforms">Fixed Virtual Platforms</a>.</p>
<section id="lava-fvp-dispatcher-setup">
<h2>LAVA FVP Dispatcher Setup<a class="headerlink" href="#lava-fvp-dispatcher-setup" title="Permalink to this heading">¶</a></h2>
<p>LAVA executes FVP devices inside Docker containers.
Therefore, like any other LAVA dispatcher that can run <cite>docker</cite> device types,
Docker needs to be
<a class="reference external" href="https://docs.docker.com/install/linux/docker-ce/debian/">installed</a>.</p>
</section>
<section id="fvp-binaries">
<h2>FVP Binaries<a class="headerlink" href="#fvp-binaries" title="Permalink to this heading">¶</a></h2>
<p>LAVA does not handle the download of FVP binaries: these are assumed to be in
the Docker image defined in the LAVA job.</p>
<p>FVP binaries are not available in any public Docker images and must be download
at <a class="reference external" href="https://developer.arm.com/tools-and-software/simulation-models/fixed-virtual-platforms">developer.arm.com</a>.
Therefore, custom Docker images must be created for this purpose. Either these
images should be built on the dispatcher to use a local image, or they can be
pushed to a <strong>private</strong> registry: FVP binaries must not be redistributed.</p>
</section>
<section id="building-fvp-docker-images">
<h2>Building FVP Docker Images<a class="headerlink" href="#building-fvp-docker-images" title="Permalink to this heading">¶</a></h2>
<p>Once FVP binaries have been obtained from <a class="reference external" href="https://developer.arm.com/tools-and-software/simulation-models/fixed-virtual-platforms">developer.arm.com</a>,
these must be built into a Docker image.</p>
<dl class="simple">
<dt>There are few dependencies:</dt><dd><ul class="simple">
<li><p>FVP Binaries</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">telnet</span></code> command. This is used to connect to a UART.</p></li>
</ul>
</dd>
</dl>
<p>For these basics, here is a sample <a class="reference external" href="examples/source/fvp/Dockerfile">Dockerfile</a> to create a Docker image for
running FVPs in LAVA, which can be built with a <code class="docutils literal notranslate"><span class="pre">docker</span> <span class="pre">build</span></code> command.</p>
</section>
<section id="networking-inside-models">
<h2>Networking inside Models<a class="headerlink" href="#networking-inside-models" title="Permalink to this heading">¶</a></h2>
<p>Optionally, if you require networking in the model, here is a way to enable this.
For this example the base OS is Ubuntu.</p>
<ul class="simple">
<li><p>Ensure <code class="docutils literal notranslate"><span class="pre">libvirt-bin</span></code> package is installed in the <code class="docutils literal notranslate"><span class="pre">Dockerfile</span></code>.</p></li>
<li><p>Add the following contents into <code class="docutils literal notranslate"><span class="pre">/etc/libvirt/hooks/network</span></code>.</p></li>
</ul>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="ch">#!/bin/bash</span>

<span class="c1"># If the change occurs to the &quot;default&quot; libvirt managed network</span>
<span class="k">if</span><span class="w"> </span><span class="o">[</span><span class="w"> </span><span class="s2">&quot;</span><span class="si">${</span><span class="nv">1</span><span class="si">}</span><span class="s2">&quot;</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">&quot;default&quot;</span><span class="w"> </span><span class="o">]</span><span class="w"> </span><span class="p">;</span><span class="w"> </span><span class="k">then</span>
<span class="w">  </span><span class="c1"># If the network is started</span>
<span class="w">  </span><span class="k">if</span><span class="w"> </span><span class="o">[</span><span class="w"> </span><span class="s2">&quot;</span><span class="si">${</span><span class="nv">2</span><span class="si">}</span><span class="s2">&quot;</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">&quot;started&quot;</span><span class="w"> </span><span class="o">]</span><span class="w"> </span><span class="p">;</span><span class="w"> </span><span class="k">then</span>
<span class="w">    </span>ip<span class="w"> </span>tuntap<span class="w"> </span>add<span class="w"> </span>mode<span class="w"> </span>tap<span class="w"> </span>tap01
<span class="w">    </span>ip<span class="w"> </span>link<span class="w"> </span><span class="nb">set</span><span class="w"> </span>tap01<span class="w"> </span>promisc<span class="w"> </span>on
<span class="w">    </span>ip<span class="w"> </span>link<span class="w"> </span><span class="nb">set</span><span class="w"> </span>tap01<span class="w"> </span>up
<span class="w">    </span>brctl<span class="w"> </span>addif<span class="w"> </span>virbr0<span class="w"> </span>tap01
<span class="w">  </span><span class="k">fi</span>
<span class="k">fi</span>
</pre></div>
</div>
<ul class="simple">
<li><p>Create a custom entrypoint script that calls <code class="docutils literal notranslate"><span class="pre">/usr/sbin/libvirtd</span> <span class="pre">&amp;</span></code> before the commands given: <code class="docutils literal notranslate"><span class="pre">exec</span> <span class="pre">&quot;$&#64;&quot;</span></code>.</p></li>
<li><p>libvirt will create a <code class="docutils literal notranslate"><span class="pre">virbr0</span></code> bridge and then a tap interface <code class="docutils literal notranslate"><span class="pre">tap01</span></code> connected to it. <code class="docutils literal notranslate"><span class="pre">tap01</span></code> is what the model will use.</p></li>
<li><p>Add the following arguments to your foundation model (other models will differ):</p></li>
</ul>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="nt">arguments</span><span class="p">:</span>
<span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">...</span>
<span class="p p-Indicator">-</span><span class="w"> </span><span class="s">&quot;--network=bridged&quot;</span>
<span class="p p-Indicator">-</span><span class="w"> </span><span class="s">&quot;--network-bridge=tap01&quot;</span>
</pre></div>
</div>
<p>This will be required if you require the use of <code class="docutils literal notranslate"><span class="pre">transfer_overlay</span></code>.
This could be useful in the event you want to pass binaries to the model that
contains the filesystem but stored in a way LAVA cannot currently put the overlay into.</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="nt">transfer_overlay</span><span class="p">:</span>
<span class="w">  </span><span class="c1"># It may be required to suppress some kernel messages</span>
<span class="w">  </span><span class="nt">download_command</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">echo 3 &gt; /proc/sys/kernel/printk ; wget</span>
<span class="w">  </span><span class="nt">unpack_command</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">tar -C / -xzf</span>
</pre></div>
</div>
</section>
<section id="reading-from-all-model-consoles">
<h2>Reading from all model consoles<a class="headerlink" href="#reading-from-all-model-consoles" title="Permalink to this heading">¶</a></h2>
<p>Sometimes models offer more than one console that produces useful output. LAVA can only write to one console at a time.
Reading can be done from multiple consoles. In some cases it’s essential to read from all consoles to prevent
model from hanging. This happens when internal model buffer is not able to accept more output because previously
generated output is not consumed. FVP boot method allows to define additional regexes to match more than one console.
This is done with <code class="docutils literal notranslate"><span class="pre">feedbacks</span></code> keyword:</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="nt">console_string</span><span class="p">:</span><span class="w"> </span><span class="s">&#39;terminal_0:</span><span class="nv"> </span><span class="s">Listening</span><span class="nv"> </span><span class="s">for</span><span class="nv"> </span><span class="s">serial</span><span class="nv"> </span><span class="s">connection</span><span class="nv"> </span><span class="s">on</span><span class="nv"> </span><span class="s">port</span><span class="nv"> </span><span class="s">(?P&lt;PORT&gt;\d+)&#39;</span>
<span class="nt">feedbacks</span><span class="p">:</span>
<span class="w">  </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="s">&#39;(?P&lt;NAME&gt;terminal_1):</span><span class="nv"> </span><span class="s">Listening</span><span class="nv"> </span><span class="s">for</span><span class="nv"> </span><span class="s">serial</span><span class="nv"> </span><span class="s">connection</span><span class="nv"> </span><span class="s">on</span><span class="nv"> </span><span class="s">port</span><span class="nv"> </span><span class="s">(?P&lt;PORT&gt;\d+)&#39;</span>
<span class="w">  </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="s">&#39;(?P&lt;NAME&gt;terminal_2):</span><span class="nv"> </span><span class="s">Listening</span><span class="nv"> </span><span class="s">for</span><span class="nv"> </span><span class="s">serial</span><span class="nv"> </span><span class="s">connection</span><span class="nv"> </span><span class="s">on</span><span class="nv"> </span><span class="s">port</span><span class="nv"> </span><span class="s">(?P&lt;PORT&gt;\d+)&#39;</span>
<span class="w">  </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="s">&#39;(?P&lt;NAME&gt;terminal_3):</span><span class="nv"> </span><span class="s">Listening</span><span class="nv"> </span><span class="s">for</span><span class="nv"> </span><span class="s">serial</span><span class="nv"> </span><span class="s">connection</span><span class="nv"> </span><span class="s">on</span><span class="nv"> </span><span class="s">port</span><span class="nv"> </span><span class="s">(?P&lt;PORT&gt;\d+)&#39;</span>
</pre></div>
</div>
<p>Feedbacks will be read twice during boot process (before matching login prompt) and periodically during test-shell.</p>
</section>
</section>


    </div>
      
  </div>
</div>
<footer class="footer">
  <div class="container">
    <p class="pull-right">
      <a href="#">Back to top</a>
      
    </p>
    <p>
        &copy; Copyright 2010-2019, Linaro Limited.<br/>
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 5.3.0.<br/>
    </p>
  </div>
</footer>
  </body>
</html>